<?php
// +----------------------------------------------------------------------
// | huicmf [ huicmf快速开发框架 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2022~2024 https://xiaohuihui.cc All rights reserved.
// +----------------------------------------------------------------------
// | Author: 小灰灰 <762229008@qq.com>
// +----------------------------------------------------------------------
// | Info:
// +----------------------------------------------------------------------

namespace libs;

class Library
{

    public static function DecimalToLetter(int $num)
    {
        $letters   = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
        $newNumStr = '';
        while ($num != 0) {
            $newNumStr = $letters[intval($num % 26)].$newNumStr;
            $num       = intval($num / 26);
        }

        return $newNumStr;
    }
}
